import 'package:flutter/material.dart';
import 'package:huajianshe_app/common/load_image.dart';
import 'package:huajianshe_app/common/res.dart';
import 'package:huajianshe_app/pages/circle/model/CircleHomeResp.dart';
import 'package:huajianshe_app/widget/OverlappedWidget.dart';
import 'package:huajianshe_app/widget/RoundedCornerWidget.dart';

class RecentCircleItem extends StatelessWidget {

  final RecentHomeCircleInfo? info;

  const RecentCircleItem(this.info, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return
      Container(width: 165, height: 200, padding: EdgeInsets.symmetric(horizontal: 5, vertical: 10), child:
      RoundedCornerWidget(radius: 13, padding: EdgeInsets.symmetric(horizontal: 13, vertical: 12),
          width: 155, height: 180, borderColor: Colors.transparent, backgroundColor: Colors.white,
          boxShadowList: [
            BoxShadow(color: Color.fromRGBO(0x00, 0x00, 0x00, 0.06), offset: Offset(0, 0), blurRadius: 17, spreadRadius: 0)
            // BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.09), blurRadius: 6.5)
          ],
          child: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [
            ClipRRect(borderRadius: BorderRadius.circular(20), child: LoadImage('${info?.cover}', width: 40, height: 40,)),
            H(7),
            Text('${info?.title}', style: TS(15, C.gray0D0E15)),
            H(3),
            SizedBox(height: 32, child:
            Text('${info?.desc}', style: TS(12, C.gray666), maxLines: 2, overflow: TextOverflow.ellipsis,),),
            H(8),
            OverlappedWidget([
              ...info?.circleMembers?.map((e) {
                return RoundedCornerWidget(width: 18, height: 18, radius: 9, padding: EdgeInsets.all(0),
                  child: LoadImage.circleAvatar(e.userInfo?.avatar ?? '', 9, holderImg: 'placeholder'), borderWidth: 1, borderColor: Colors.white);

                  //LoadImage(e.userInfo?.avatar, width: 20, height: 20,);
              }).toList() ?? [H(20)]
            ], 20, 20, -10),
            H(3),
            Text('${info?.memberNum}人加入圈子', style: TS(11, C.gray333),)
          ],)
    ));
  }
}